Andre Carregal | 1 Sep 03:02
Picon

[ANN] Xavante 1.3.1 Released

Xavante is a Lua HTTP 1.1 Web server that uses a modular architecture
based on URI mapped handlers. Xavante currently offers a file handler,
a redirect handler and a CGILua handler. Those are used for general files,
URI remapping and CGILua scripts respectively.

Xavante is free software and uses the same license as Lua.

Xavante 1.3.1 [31/Aug/2007]
* Replaces the use of the cgi table by cgilua.POST and cgilua.QUERY in
the examples
* Correcting the behavior of coxpcall when used with C functions
(patch by Ignacio Burgueño)
* Correcting issues with chucked encoding. Now it only sends the
Transfer-Encoding header when necessary. (patch by Ignacio Burgueño)
* Correcting the handling of cached files in filehandler. (patch by
Ignacio Burgueño)
* New /web structure, using a dynamic index to documentation in
/web/doc/modulename

Xavante source and documentation can be found at
http://www.keplerproject.org/xavante/

Feedback is welcome!

Andre

Gravatar

Re: Compiler Optimizations

On Friday 31 August 2007, Chris Swetenham wrote:
> I've thought about this a few times - are there any common or useful use
> cases of metatables where the assumption that metatable functions are
> idempotent (that is, the program state is the same after calling the
> function once as it is after calling it twice), AND that they only modify
> the table they are associated with, would lead to incorrect semantics?
>
> An obvious and trivial example is a metatable that counts accesses to a
> table, but this would usually be used for debugging/profiling rather than
> in production; I've not been able to think of any other examples.

any kind of proxy table.

the table associated with the functions isn't (usually) modified, but the 
underlying (hidden) table is.

--

-- 
Javier
David Manura | 1 Sep 04:17
Favicon

Re: ... can't be upvalue?

David Kastrup <dak <at> gnu.org> writes:
> I tried something like
> function x(...) return function()
>   for i=1, select('#', ...) do print(select(i,...)) end
> end end

For a detailed description of the limitations in expressivity when
using "varargs" (or, more generally, "expression lists" in the Lua
grammar), see the recently updated

  http://lua-users.org/wiki/VarargTheSecondClassCitizen

I think it can be summed up as this: expression lists are awkward
to work with.  They are not first-class objects in Lua.  Tables
are more convenient to work with, but converting expression lists
to tables while preserving nil's is idiosyncratic,
{n=select('#',...),...}, and can be less efficient than necessary
due to the additional function calls, table construction, and possible
final unpack.

Allowing the above code (vararg as an upvalue) would increase
expressivity, and as Kristofer mentioned in this thread, operators
and opcodes for vararg manipulation may help somewhat, and some
have suggested immutable tuples as a solution.

Joe Smith | 1 Sep 05:54
Picon

Re: Unidecode - US-ASCII transliterations of Unicode text

Line 52 of 01.txt lacks an ascii equivlent when "ij" (both lowercase) is the 
clear correct equivlent. 

XenoLiz | 1 Sep 06:10
Picon

Re: Re: Targeting the Lua VM From: Stefan Sandberg

Message: 21    Date: Fri, 31 Aug 2007 15:28:55 +0200    From: Stefan Sandberg <keffo.sandberg <at> gmail.com>

Are you just trolling, or are you seriously suggesting a rewrite of lua to c++, toss away the GC and inject it with boost??

Вы только троллинг, или Вы серьезно о том, переписан LUA для С + +, Мальчик вне GC и придать ей импульс?

At C LuaVM already published here. (w GC) [You must catch the mistakes and correct this, if it`s interested]
( for C moving GC - very difficult )
For himself, I re in C++ (no GC, and the STL & Boost 1.33.1)
XenoLiz | 1 Sep 06:10
Picon

Re: Re: Targeting the Lua VM

    Calm down, XenoLiz, whoever you are. They are just examples of

language platforms that are probably more suitable for multiple

languages on the front end portion. I am neutral about them,

technology-wise.

    Спокойствие вниз, XenoLiz, кто вы. Они просто примеры
язык платформ, которые, возможно, более подходящие для нескольких
языков на передней части. Я нейтральная о них,
технологии мудрым.

 Yes, i know. Thank you for this assertion.

    Most of us are fully aware of "embrace, extend

and extinguish" but here, we are talking about technology. On this

list, the discussions are almost always very civil and rational,

so I always assume everyone is mature enough to decide on their

own whether or not to use these technologies.

    Большинство из нас полностью осознают "объятий продлить
и аннулирование"( обнимать, продлить
и потушить), но здесь мы говорим о технологии. Об этом
список обсуждений почти всегда очень гражданского и рациональным,
поэтому я всегда себя каждый достаточно принять решение об их
собственный ли использовать эти технологии.

    Consider it an academic exercise. By your rants, you are just

wasting everyone's time. Let us instead have a more meaningful

discussion on this list. Well then, Java is a pretty complete

platform too, but of course, they are all pretty big. In the end,

it is a matter of how much of a language one wants to implement. I

don't think anyone can avoid language subsets, they are the

necessary first steps if one wants to support a second language on

the Lua backend. I don't think discussions are that important --

working code is tens of times more valuable. What's more

meaningful would be to code something and then see the response of

the community. It might well end up as an academic exercise.

   

Считайте, что теоретизировать. В вашем Ранц, вы просто
тратить все время. Давайте вместо этого, более значимой
обсуждение данного списка. Тогда, Java является довольно полный
платформы, но, конечно, все они довольно большие. В конце концов,
это вопрос того, какой язык, хочет осуществить. Я
не думаю, что кто-то может избежать подмножества языка, они
необходимые первые шаги для тех, кто хочет поддержать Второй язык
Lua выходными. Я не думаю, что обсуждение этого важного --
рабочий код, в десятки раз более ценным. Более того
значимыми будут кодировать что-то, а затем см. ответ
сообщества. Возможно, в конечном итоге, как теоретизировать.

I don't understand you. In this treat start on discussions union script langs by Lua VM.

One decision based on compile and this paths release (may be) for Ruby and Python for Lua 4,

So about this release on vertion 5, I don`t know. 

Perhaps writing and universal virtual machine.
But as you rightly note, leading to complex (as in writing, accompaniment, and the example jvm using)

 

    I don't understand you. Can you please write better English? Thank

you. Clarity in speaking and thinking will be good for you and for

everyone who choose to listen to you. I do wish to understand what

you are trying to say.

    Я не понимаю вас. Вы пишите лучше на английском? Спасибо
Вас. Ясность в выступаю и мышления будет для Вас и для
каждый, кто решил выслушать вас. Я
хочу понять, что
Вы пытаетесь сказать.

No, I can`t. May be better write on C++? I am use idea SimSkin 2.23 for LuaVM. So now I am in the beginning. If

you are interested, we can discuss it.
 

 

Thank you for your participation.
Picon

Win32 Lua to EXE

Hi!

Help me please.
I'm use lua 1 month.
How to build lua-source file to Win32-EXE file?

Now, I Use Wrapper:

/*--------------------------------------------*/
#include <stdio.h>
#include < lua.h>
#include <lauxlib.h>
#include <lualib.h>

int main(int argc, char* argv[])
{
int error;
lua_State *L = lua_open();

luaL_openlibs(L);

error =  luaL_dofile(L," file.lc");   

if(error)
{
printf("ERROR: %s \n", lua_tostring(L, -1));
lua_pop(L, 1);
}

lua_close(L);

return 0;
}
/*--------------------------------------------*/

file.lc - Lua ByteCode (make with luac.exe)

I want build single-exe file.

Duck | 1 Sep 10:39

loadstring() of compiled-in data buffer


If I call luaL_loadstring(), passing it a pointer to a compiled-in static 
data buffer containing compiled Lua bytecode (rather than Lua source), 
does the Lua state make and ultimately use a copy of the data in my 
buffer?

I assume it does, in order to leave me free to dispose of my copy of the 
bytecode afterwards, but if so, is there I way I can tell the Lua state to 
use _my_ buffer of bytecode and not to make its own copy?

I am looking for a way to include pre-compiled Lua code inside my Lua 
binary, but in such a way that this bytecode doesn't end up in memory 
twice (e.g. once on the heap as part of the Lua state and once in the 
initialised data section as part of the Lua binary).

The idea is to be able to convert Lua programs into a single executable 
containing the Lua runtime, all needed C libraries statically linked in, 
and all needed Lua sources built-in, but precompiled to save time and 
space. The memory wasted through having two copies of the Lua bytecode, 
though trivial on PCs, would surely be worth saving on low-RAM embedded 
devices such as routers (e.g. Linksys WRT54G) and phone-PDAs (e.g. HTC 
Wizard).

Sherry Zhang | 1 Sep 12:24
Picon

Re: Win32 Lua to EXE

well, do not do the file.

first, use luac to compile it to bytecode
second, make the byte code a C char array and include it into your C file
third. use lua_loadbuffer to load your C string.
and last, use pcall to run it.

On 9/1/07, Александр Лейкин <leykina <at> gmail.com> wrote:
> Hi!
>
> Help me please.
> I'm use lua 1 month.
> How to build lua-source file to Win32-EXE file?
>
> Now, I Use Wrapper:
>
> /*--------------------------------------------*/
> #include <stdio.h>
> #include < lua.h>
> #include <lauxlib.h>
> #include <lualib.h>
>
> int main(int argc, char* argv[])
> {
> int error;
> lua_State *L = lua_open();
>
> luaL_openlibs(L);
>
> error =  luaL_dofile(L," file.lc");
>
> if(error)
> {
> printf("ERROR: %s \n", lua_tostring(L, -1));
> lua_pop(L, 1);
> }
>
> lua_close(L);
>
> return 0;
> }
> /*--------------------------------------------*/
>
> file.lc - Lua ByteCode (make with luac.exe)
>
> I want build single-exe file.
>
KHMan | 1 Sep 12:33
Picon

Re: Targeting the Lua VM

XenoLiz wrote:
> [snip]
> I don't understand you. In this treat start on discussions union script
> langs by Lua VM.
> 
> One decision based on compile and this paths release^  (may be) for Ruby
> and Python for Lua 4,
> 
> So about this release^  on vertion 5, I don`t know. 
> 
> Perhaps writing and universal virtual machine.
> But as you rightly note, leading to complex (as in writing,
> accompaniment, and the example jvm using)
> 
> [snip] 
> 
> No, I can`t. May be better write on C++? I am use idea SimSkin 2.23 for
> LuaVM. So now I am in the beginning. If
> 
> you are interested, we can discuss it.

Thanks for replying, it is appreciated. However, since there is
still a communication problem, it will be difficult to get ideas
across clearly. In light of this impedance matching problem, I
will drop out of this discussion and leave others to reply.

Thanks again and happy coding,
--

-- 
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


Gmane