Getting Started with Lua

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

Getting Started with Lua

Luiz Henrique de Figueiredo
Does the Lua web site need a page "Getting Started with Lua",
perhaps along the lines of http://python.org/about/gettingstarted/ ?

Or is the site map enough?
        http://www.lua.org/map.html

I've tried this but I cannot find the right tone or level of detail:
        http://www.tecgraf.puc-rio.br/~lhf/tmp/start.htm

(The links to other pages in lua.org do not work, only internal links do,
sorry. But they will work when and if the page is moved to lua.org.)

I welcome suggestions, including "no, we don't need this"... Thanks.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Gavin Wraith
In message <[hidden email]> you wrote:

> Does the Lua web site need a page "Getting Started with Lua",
> perhaps along the lines of http://python.org/about/gettingstarted/ ?
> ............................
> I've tried this but I cannot find the right tone or level of detail:
>      http://www.tecgraf.puc-rio.br/~lhf/tmp/start.htm
> .........................
> I welcome suggestions, including "no, we don't need this"... Thanks.

Please excuse some rather obvious remarks about this. It is necessary
to distinguish between 1) the levels of programming experience that
the newcomer to Lua already has, and 2) the platforms that she is
accustomed to use.

I would suggest that the complete beginner, with no programming
experience, is best catered for by platform-specific tutorials.

For the more experienced I think it would be good for the Lua website
to have some sample programs illustrating Lua's strengths, possibly
giving comparisons with other languages. See, for example, Michael
Newberry's remarks on the LuaList on Tue, 30 Nov 2004:
"Re: Why Lua is not BASIC - other articles?"
As always, the difficulty is in finding programming tasks to
illustrate that are neither too lengthy nor too trivial.

--
Gavin Wraith ([hidden email])
Home page: http://www.wra1th.plus.com/

Reply | Threaded
Open this post in threaded view
|

RE: Getting Started with Lua

Thijs Schreijer


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of Gavin Wraith
> Sent: woensdag 21 december 2011 22:49
> To: [hidden email]
> Subject: Re: Getting Started with Lua
>
> In message <[hidden email]> you
> wrote:
>
> > Does the Lua web site need a page "Getting Started with Lua",
> > perhaps along the lines of http://python.org/about/gettingstarted/ ?
> > ............................
> > I've tried this but I cannot find the right tone or level of detail:
> >      http://www.tecgraf.puc-rio.br/~lhf/tmp/start.htm
> > .........................
> > I welcome suggestions, including "no, we don't need this"... Thanks.
>
> Please excuse some rather obvious remarks about this. It is necessary
> to distinguish between 1) the levels of programming experience that
> the newcomer to Lua already has, and 2) the platforms that she is
> accustomed to use.
>
> I would suggest that the complete beginner, with no programming
> experience, is best catered for by platform-specific tutorials.
>
> For the more experienced I think it would be good for the Lua website
> to have some sample programs illustrating Lua's strengths, possibly
> giving comparisons with other languages. See, for example, Michael
> Newberry's remarks on the LuaList on Tue, 30 Nov 2004:
> "Re: Why Lua is not BASIC - other articles?"
> As always, the difficulty is in finding programming tasks to
> illustrate that are neither too lengthy nor too trivial.

I wouldn't do it along those Lines. Here's my 2cts;

The way I see it Lua has 2 audiences;
  1 - Lua coders
  2 - Lua embedders
Both with a completely different need, so give them both their own heading
on the page. The latter would require quick links to the API and some C
examples. The former needs access to the basic tools and Lua language
help/FAQ/wiki.
The platform specific stuff is beyond any beginner audience anyway (except
for platform specific startup items like the IDE's etc.)

For learning resources; PiL, Lua reference, FAQ, unofficial FAQ, wiki.





Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Joseph Stewart
Take a look at golang.org as I nice "getting started" example.

On Wednesday, December 21, 2011, Thijs Schreijer <[hidden email]> wrote:
>
>
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]]
>> On Behalf Of Gavin Wraith
>> Sent: woensdag 21 december 2011 22:49
>> To: [hidden email]
>> Subject: Re: Getting Started with Lua
>>
>> In message <[hidden email]> you
>> wrote:
>>
>> > Does the Lua web site need a page "Getting Started with Lua",
>> > perhaps along the lines of http://python.org/about/gettingstarted/ ?
>> > ............................
>> > I've tried this but I cannot find the right tone or level of detail:
>> >      http://www.tecgraf.puc-rio.br/~lhf/tmp/start.htm
>> > .........................
>> > I welcome suggestions, including "no, we don't need this"... Thanks.
>>
>> Please excuse some rather obvious remarks about this. It is necessary
>> to distinguish between 1) the levels of programming experience that
>> the newcomer to Lua already has, and 2) the platforms that she is
>> accustomed to use.
>>
>> I would suggest that the complete beginner, with no programming
>> experience, is best catered for by platform-specific tutorials.
>>
>> For the more experienced I think it would be good for the Lua website
>> to have some sample programs illustrating Lua's strengths, possibly
>> giving comparisons with other languages. See, for example, Michael
>> Newberry's remarks on the LuaList on Tue, 30 Nov 2004:
>> "Re: Why Lua is not BASIC - other articles?"
>> As always, the difficulty is in finding programming tasks to
>> illustrate that are neither too lengthy nor too trivial.
>
> I wouldn't do it along those Lines. Here's my 2cts;
>
> The way I see it Lua has 2 audiences;
>  1 - Lua coders
>  2 - Lua embedders
> Both with a completely different need, so give them both their own heading
> on the page. The latter would require quick links to the API and some C
> examples. The former needs access to the basic tools and Lua language
> help/FAQ/wiki.
> The platform specific stuff is beyond any beginner audience anyway (except
> for platform specific startup items like the IDE's etc.)
>
> For learning resources; PiL, Lua reference, FAQ, unofficial FAQ, wiki.
>
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Daniel Aquino
Some try sites like haskell's have full blown walk throughs..


On Wed, Dec 21, 2011 at 5:35 PM, Joseph Stewart
<[hidden email]> wrote:

> Take a look at golang.org as I nice "getting started" example.
>
> On Wednesday, December 21, 2011, Thijs Schreijer <[hidden email]>
> wrote:
>>
>>
>>> -----Original Message-----
>>> From: [hidden email] [mailto:[hidden email]]
>>> On Behalf Of Gavin Wraith
>>> Sent: woensdag 21 december 2011 22:49
>>> To: [hidden email]
>>> Subject: Re: Getting Started with Lua
>>>
>>> In message <[hidden email]> you
>>> wrote:
>>>
>>> > Does the Lua web site need a page "Getting Started with Lua",
>>> > perhaps along the lines of http://python.org/about/gettingstarted/ ?
>>> > ............................
>>> > I've tried this but I cannot find the right tone or level of detail:
>>> >      http://www.tecgraf.puc-rio.br/~lhf/tmp/start.htm
>>> > .........................
>>> > I welcome suggestions, including "no, we don't need this"... Thanks.
>>>
>>> Please excuse some rather obvious remarks about this. It is necessary
>>> to distinguish between 1) the levels of programming experience that
>>> the newcomer to Lua already has, and 2) the platforms that she is
>>> accustomed to use.
>>>
>>> I would suggest that the complete beginner, with no programming
>>> experience, is best catered for by platform-specific tutorials.
>>>
>>> For the more experienced I think it would be good for the Lua website
>>> to have some sample programs illustrating Lua's strengths, possibly
>>> giving comparisons with other languages. See, for example, Michael
>>> Newberry's remarks on the LuaList on Tue, 30 Nov 2004:
>>> "Re: Why Lua is not BASIC - other articles?"
>>> As always, the difficulty is in finding programming tasks to
>>> illustrate that are neither too lengthy nor too trivial.
>>
>> I wouldn't do it along those Lines. Here's my 2cts;
>>
>> The way I see it Lua has 2 audiences;
>>  1 - Lua coders
>>  2 - Lua embedders
>> Both with a completely different need, so give them both their own heading
>> on the page. The latter would require quick links to the API and some C
>> examples. The former needs access to the basic tools and Lua language
>> help/FAQ/wiki.
>> The platform specific stuff is beyond any beginner audience anyway (except
>> for platform specific startup items like the IDE's etc.)
>>
>> For learning resources; PiL, Lua reference, FAQ, unofficial FAQ, wiki.
>>
>>
>>
>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Petite Abeille
In reply to this post by Luiz Henrique de Figueiredo

On Dec 21, 2011, at 10:12 PM, Luiz Henrique de Figueiredo wrote:

> I welcome suggestions, including "no, we don't need this"... Thanks.

This seems just a repackaging of existing materials (about, faq, pil, wiki). Why bother? Who is it intended for?


Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Luiz Henrique de Figueiredo
> This seems just a repackaging of existing materials (about, faq, pil, wiki).

That was my point. Does the site map, which has links to all those, suffice?
Or does anyone actually look at the site map??

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Petite Abeille

On Dec 22, 2011, at 12:11 AM, Luiz Henrique de Figueiredo wrote:

> That was my point. Does the site map, which has links to all those, suffice?
> Or does anyone actually look at the site map??

Hmmm... now that you mention it... I don't think I ever looked at the site map itself.

Not to say it's not useful -now that you have pointed it out- but I usually go straight to, say, docs or about, etc.

More generally, I don't recall feeling the need to use a "site map" since the advent of search engines or perhaps even before.

A half decent navigation structure is good enough in principle, and I find Lua site very simple to navigate as is.


Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Peter Cawley
In reply to this post by Luiz Henrique de Figueiredo
On Wed, Dec 21, 2011 at 11:11 PM, Luiz Henrique de Figueiredo
<[hidden email]> wrote:
>> This seems just a repackaging of existing materials (about, faq, pil, wiki).
>
> That was my point. Does the site map, which has links to all those, suffice?
> Or does anyone actually look at the site map??

Firstly, I'd like to state that I think packaging can be very
important. The phase "just a repackaging" sounds rather derogatory,
but I don't think that it should (or at least, not always). If good
information cannot be found, or people don't realise that they are a
few clicks away from good information, or good information is scatted
over various pages in an unorganised manner, then said information
might as well not exist.

Secondly, I used to use the site map a lot, as I found the
organisation of pages into about / download / documentation headings
to be rather arbitrary. Nowadays I've memorised the URLs of all the
pages I commonly go to, and so I rarely use the navigation. Unlike
Petite, I don't (or at least didn't) find the Lua site simple to
navigate (and navigating by going directly to the URL rather than
using the links is probably a sign of this), though I do agree that
site maps should be deprecated in favour of decent navigation.

Compared to other programming language sites (e.g. haskell.org,
python.org), I find the Lua site to be very spartan. Perhaps this
reflects the philosophy of Lua, but I think that it may be too spartan
(again, the phrase "web 2.0 site" can often be derogatory, but there
must have been some advancements in web design in the last decade).
For example, the Python site has a nice little blurb (whereas an
equivalent blurb for Lua is hidden behind an "about" link), and the
Haskell site has a really obvious "Download Haskell" button, whereas
for Lua you need to follow the "download" link, then find the small
"Lua 5.2.0" link (which given the context of the link, I'd have
thought went to another page if it weren't for the .tar.gz extension
on the URL). Alternatively, following the "source" link goes to
http://www.lua.org/ftp/, which makes all the right visual cues for
download links, though I'd argue that files should be sorted by
descending version number rather than ascending version number, as I'd
expect more people to be looking for 5.2 than looking for 1.0.

Likewise, I find the Lua Users Wiki to be very spartan and rather
unfriendly in terms of navigation and style (conversely the content is
generally comprehensive and friendly). I'm veering even more off-topic
with this though, so I'll leave it there.

Like Gavin, I think that any "Getting Started" area is going to have
multiple distinct audiences. An experienced programmer seeing Lua for
the first time will want "The [C | Javascript | ...] coder's guide to
Lua syntax and semantics", followed by a link to the standard library
reference, or they might want "How to embed Lua into your [C | C++]
program, and why you might want to", followed by a link to the C API
reference. Conversely, inexperienced programmers probably want to be
pointed toward a particular embedding of Lua, be it Love2D, WoW
Addons, etc. There is probably a semi-experienced programmer group
somewhere between, and I'm not sure what would be best for them.

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

GrahamH
In reply to this post by Thijs Schreijer

On 22/12/2011, at 9:06 AM, Thijs Schreijer wrote:

>
>
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]]
>> On Behalf Of Gavin Wraith
>> Subject: Re: Getting Started with Lua
>>
>>> Does the Lua web site need a page "Getting Started with Lua",
>>> perhaps along the lines of http://python.org/about/gettingstarted/ ?
>>> ............................
>>> I've tried this but I cannot find the right tone or level of detail:
>>>     http://www.tecgraf.puc-rio.br/~lhf/tmp/start.htm
>>> .........................
>>> I welcome suggestions, including "no, we don't need this"... Thanks.
>>
>> Please excuse some rather obvious remarks about this. It is necessary
>> to distinguish between 1) the levels of programming experience that
>> the newcomer to Lua already has, and 2) the platforms that she is
>> accustomed to use.
>>
>
> I wouldn't do it along those Lines. Here's my 2cts;
>
> The way I see it Lua has 2 audiences;
>  1 - Lua coders
>  2 - Lua embedders
> Both with a completely different need, so give them both their own heading
> on the page. The latter would require quick links to the API and some C
> examples. The former needs access to the basic tools and Lua language
> help/FAQ/wiki.
> The platform specific stuff is beyond any beginner audience anyway (except
> for platform specific startup items like the IDE's etc.)
>
> For learning resources; PiL, Lua reference, FAQ, unofficial FAQ, wiki.
>

Being an occasional Lua embedder and coder but expert at neither, a Getting Started with Lua guide split between coders and embedded users is the way to go. Lua 5.2 is in particular need of this. I tend to be a passive listener to this list and realise most list participants are strong full-time programmers or academics for whom the reference material is probably adequate. However for students (especially non CS ones) and programmers for whom programming is not their core job (like me), additional material would be appreciated.

As an example of the problems encountered but not easily resolved is the porting of 5.1.4 embedded code to 5.2. To familiarise myself with 5.2 I decided on the progressive top down elimination of all depreciated functions. I have spend a lot of time trying to work out why I am unable to load my libraries. I reasonably sure its an environment issue, but the reference manual and looking at lua.c and other source do not help. I need a Getting Started with Lua (Embedded) guide with sample code!

Graham
Reply | Threaded
Open this post in threaded view
|

RE: Getting Started with Lua

Thijs Schreijer
In reply to this post by Peter Cawley
>
> On Wed, Dec 21, 2011 at 11:11 PM, Luiz Henrique de Figueiredo
> <[hidden email]> wrote:
> >> This seems just a repackaging of existing materials (about, faq,
> pil, wiki).
> >
> > That was my point. Does the site map, which has links to all those,
> suffice?
> > Or does anyone actually look at the site map??
>
> Firstly, I'd like to state that I think packaging can be very
> important. The phase "just a repackaging" sounds rather derogatory,
> but I don't think that it should (or at least, not always). If good
> information cannot be found, or people don't realise that they are a
> few clicks away from good information, or good information is scatted
> over various pages in an unorganised manner, then said information
> might as well not exist.

Totally agree. Recollecting my initial experience; I felt the info was
scattered all over the place(s). My best resource actually were the
extensive help/reference files delivered with Girder (www.promixis.com),
because it got me everything in one place.


Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Luiz Henrique de Figueiredo
In reply to this post by GrahamH
> I have spend a lot of time trying to work out why I am unable to load
> my libraries.

If you build Lua 5.2.0 using the Makefiles provided in the tarball then
all compatibility switches are on and C code for 5.1 should work just fine
in 5.2.

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Shmuel Zeigerman
On 22/12/2011 13:03, Luiz Henrique de Figueiredo wrote:
> If you build Lua 5.2.0 using the Makefiles provided in the tarball then
> all compatibility switches are on and C code for 5.1 should work just fine
> in 5.2.

What does it mean "work just fine"? C code for 5.1 won't even compile.
For example: luaL_reg, luaL_register in the 5.1 C code are not defined
with 5.2 headers, to name a few.
(The original src/Makefile was used to build Lua 5.2).

--
Shmuel

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Luiz Henrique de Figueiredo
> On 22/12/2011 13:03, Luiz Henrique de Figueiredo wrote:
> >If you build Lua 5.2.0 using the Makefiles provided in the tarball then
> >all compatibility switches are on and C code for 5.1 should work just fine
> >in 5.2.
>
> What does it mean "work just fine"? C code for 5.1 won't even compile.
> For example: luaL_reg, luaL_register in the 5.1 C code are not defined
> with 5.2 headers, to name a few.
> (The original src/Makefile was used to build Lua 5.2).

I'm sorry, you also need to compile your libraries with LUA_COMPAT_ALL on or
at leas LUA_COMPAT_MODULE on. About luaL_reg, it was not defined in 5.1;
it worked for compatibility with 5.0. This has indeed been removed.

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Luiz Henrique de Figueiredo
> About luaL_reg, it was not defined in 5.1; it worked for compatibility
> with 5.0. This has indeed been removed.

You need to use luaL_Reg instead.

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Roberto Ierusalimschy
> > About luaL_reg, it was not defined in 5.1; it worked for compatibility
> > with 5.0. This has indeed been removed.
>
> You need to use luaL_Reg instead.

See http://lua-users.org/lists/lua-l/2011-11/msg00256.html

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Patrick Rapin
> You need to use luaL_Reg instead.

For the records, I have just ported LuaSocket 2.0.2 for Lua 5.2.
I had to make three modifications:
 - changed a bunch of luaL_reg into luaL_Reg
 - changed a number of luaL_putchar into luaL_addchar
 - implemented luaL_typerror since it has been removed (why?)

The result can be found here [1].
I also have sent a pull request to Sam Roberts.

[1] https://github.com/prapin/luasocket

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Ignacio Burgueño

On Thu, Dec 22, 2011 at 1:00 PM, Patrick Rapin <[hidden email]> wrote:
> You need to use luaL_Reg instead.

For the records, I have just ported LuaSocket 2.0.2 for Lua 5.2.
I had to make three modifications:
 - changed a bunch of luaL_reg into luaL_Reg
 - changed a number of luaL_putchar into luaL_addchar
 - implemented luaL_typerror since it has been removed (why?)


ltn12 is still using "arg" and "table.getn"

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

Patrick Rapin
> ltn12 is still using "arg" and "table.getn"

Thanks. In fact, I only needed the socket.core module for my scripts,
and for that reason I have only fixed C compilation.
So yes, Lua code,  as you correctly point out, also needs revision !

Reply | Threaded
Open this post in threaded view
|

Re: Getting Started with Lua

N.N.
In reply to this post by Luiz Henrique de Figueiredo
Yes, I am in the same situation as Graham.
I am a good occasional programmer but Lua isn't simple to manage.
The language is too rich and too powerfull to manage in a couple of hours.
I also 'll be happy with many source code programsample, from the very
beginning to the most difficult.

Alain.

----------

Graham wrote :

Being an occasional Lua embedder and coder but expert at neither, a
Getting Started with Lua guide split between coders and embedded users
is the way to go. Lua 5.2 is in particular need of this. I tend to be
a passive listener to this list and realise most list participants are
strong full-time programmers or academics for whom the reference
material is probably adequate. However for students (especially non CS
ones) and programmers for whom programming is not their core job (like
me), additional material would be appreciated.

As an example of the problems encountered but not easily resolved is
the porting of 5.1.4 embedded code to 5.2. To familiarise myself with
5.2 I decided on the progressive top down elimination of all
depreciated functions. I have spend a lot of time trying to work out
why I am unable to load my libraries. I reasonably sure its an
environment issue, but the reference manual and looking at lua.c and
other source do not help. I need a Getting Started with Lua (Embedded)
guide with sample code!

Graham


--
Complex numbers: They are all fun and games until someone loses an i.

1234