[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is Lua right for me?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 3 Jan 2001 21:46:05 -0200 (EDT)
> a) usable for people who aren't programmers (think engineering
>students). Lua looks like it might be ok here.
This kind of audience was one of the original targets of Lua.
> b) fast enough to do simple arithmetic on enourmous data sets (2d
>image manipulation). it doesn't have to be real-time, but it shouldn't be in
>elephant time either. any opinions?
Such primitives are better implemented in C. See ImageKitchen in our uses page.
> c) limitable. i need to be able to limit the language to keep users
>from going outside the scope of the host application. can this be done with
This is very easy to do, especially in Lua 4.0.
When you create a state, it's empty. You can export only the functions you
need (eg, your own image library) and/or export Lua libraries and explicitly
remove whatever is not wanted. This removal is easy to do too, and can be done
in Lua itself.
> d) usable with huge data sets. i read a few messages about Lua's
>garbage collection system and images that give me doubts.. i want to create
>"image" objects that allocate data with Win32's GlobalAlloc function, and i
>need this memory to be released when the object goes out of scope. is Lua's
>GC going to complicate this?
If your images are stored in Lua variables as userdata, then you'll be
warned via GC tag methods when they are collected.
You can control when GC happens by setting the GC threshold.
Or you can use lua_newuserdata to allocate and register image objects for GC.