Lua : Where can I get some more example code ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua : Where can I get some more example code ?

Luc Van den Borre
Hello everyone,

I'm new to Lua, I've just embedded the language in a game engine and am now
faced with the task to write some scripts. 
The language looks very simple to get to grips with, but I was hoping there would 
be some more example code available then what's included with the source code...

Anyone ?

Thanks!

--Luc

Reply | Threaded
Open this post in threaded view
|

Re: Lua : Where can I get some more example code ?

Luiz Henrique de Figueiredo
>From [hidden email] Mon May 18 06:14:15 1998
>
>I'm new to Lua, I've just embedded the language in a game engine and am now
>faced with the task to write some scripts. 
>The language looks very simple to get to grips with, but I was hoping there would 
>be some more example code available then what's included with the source code...

Have you tried the code listed in the add-ons page?

Of course, we do have *lots* of code in Lua, but not much that would be of
immediate use to anyone else. Plus, much of the code assumes that appropriate
C functions have been registered. Of course, this is as it should be, since
Lua is used as an embedded language.

Now, two questions to everyone:
- Are the examples in the distribution too trivial or useless?
- What would you suggest instead?

--lhf

Reply | Threaded
Open this post in threaded view
|

RE: Lua : Where can I get some more example code ?

Luc Van den Borre
| Have you tried the code listed in the add-ons page?

I found TkLua quite useful as an example, the others less so.
I wasn't able to download poslib and tolua, because the ftp servers didn't respond...

| Of course, we do have *lots* of code in Lua, but not much that would be of
| immediate use to anyone else. Plus, much of the code assumes that appropriate
| C functions have been registered. Of course, this is as it should be, since
| Lua is used as an embedded language.

Well, I was looking for a language to embed, and in the end was left with a choice
between Lua and Python. Not having actually used either, I had to make a choice between
them based on what I could find on the net. One of the points where Python scored much
better over Lua was the amount of code readily available, which to me made me feel I
could trust Python to be well tested and stable. For Lua, I don't feel as sure
about its stability, as I have no proof that there's lots of people out there using it for
large projects.
 
| Now, two questions to everyone:
| - Are the examples in the distribution too trivial or useless?

They are okay to get started, definitely usefull. But they're toy programs, and I would have 
liked to see a real-world program.

| - What would you suggest instead?

Lua users worldwide to make public some of their code!

By the way, congratulations to the authors for producing and supporting Lua!
It's looking great, and I'm quite happy with the quick progress I'm making...

--Luc