Join Amazon Prime and ship Two-Day for free and Overnight for $3.99. Already a member? Sign in.

 

or
Sign in to turn on 1-Click ordering.
 
   
More Buying Choices
38 used & new from $25.66

Have one to sell? Sell yours here
 
   
Programming in Lua, Second Edition
 
 
Tell the Publisher!
I’d like to read this book on Kindle

Don’t have a Kindle? Get yours here.
 
  

Programming in Lua, Second Edition (Paperback)

by Roberto Ierusalimschy (Author) "To keep with the tradition, our first program in Lua just prints "Hello World": print("Hello World")..." (more)
Key Phrases: Jon Bentley, Literate Programming, More Programming Pearls
4.8 out of 5 stars See all reviews (25 customer reviews)

List Price: $39.95
Price: $26.37 & this item ships for FREE with Super Saver Shipping. Details
You Save: $13.58 (34%)
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

21 new from $25.77 17 used from $25.66
Also Available in: List Price: Our Price: Other Offers:
Paperback 16 used & new from $22.45

Frequently Bought Together

Programming in Lua, Second Edition + Lua 5.1 Reference Manual + Lua Programming Gems
Price For All Three: $76.07

Show availability and shipping details

  • This item: Programming in Lua, Second Edition by Roberto Ierusalimschy

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details

  • Lua 5.1 Reference Manual by Roberto Ierusalimschy

    In Stock.
    Ships from and sold by Amazon.com.
    Eligible for FREE Super Saver Shipping on orders over $25. Details

  • Lua Programming Gems by Luiz Henrique de Figueiredo

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details


Customers Who Bought This Item Also Bought

World of Warcraft Programming: A Guide and Reference for Creating WoW Addons

World of Warcraft Programming: A Guide and Reference for Creating WoW Addons

by James Whitehead II
4.6 out of 5 stars (17)  $25.19
Lua Programming Gems

Lua Programming Gems

by Luiz Henrique de Figueiredo
$34.12
Beginning Lua Programming (Programmer to Programmer)

Beginning Lua Programming (Programmer to Programmer)

by Kurt Jung
3.3 out of 5 stars (6)  $29.19
Game Development With LUA (Game Development Series)

Game Development With LUA (Game Development Series)

by Paul Schuytema
3.5 out of 5 stars (2)  $37.96
Hacking World of Warcraft (ExtremeTech)

Hacking World of Warcraft (ExtremeTech)

by Daniel Gilbert
3.8 out of 5 stars (28)  $19.79
Explore similar items

Editorial Reviews

Review
"the book presents so many good ideas, and presents them so artfully, that it's worth reading." -- UnixReview.com, May 2004

Product Description
Lua is the language of choice for anyone who needs a scripting language that is simple, efficient, extensible, portable, and free. Currently, Lua is being used in areas ranging from embedded systems to Web development and is widely spread in the game industry, where knowledge of Lua is an indisputable asset.

"Programming in Lua" is the official book about the language, giving a solid base for any programmer who wants to use Lua. Authored by Roberto Ierusalimschy, the chief architect of the language, it covers all aspects of Lua 5---from the basics to its API with C---explaining how to make good use of its features and giving numerous code examples. "Programming in Lua" is targeted at people with some programming background, but does not assume any prior knowledge about Lua or other scripting languages.

This Second Edition updates the text to Lua 5.1 and brings substantial new material, including numerous new examples, a detailed explanation of the new module system, and two new chapters centered on multiple states and garbage collection.

See all Editorial Reviews


Product Details

  • Paperback: 328 pages
  • Publisher: Lua.org; 2 edition (March 5, 2006)
  • Language: English
  • ISBN-10: 8590379825
  • ISBN-13: 978-8590379829
  • Product Dimensions: 9.4 x 7.4 x 0.8 inches
  • Shipping Weight: 1.3 pounds (View shipping rates and policies)
  • Average Customer Review: 4.8 out of 5 stars See all reviews (25 customer reviews)
  • Amazon.com Sales Rank: #13,790 in Books (See Bestsellers in Books)

    Popular in this category: (What's this?)

    #91 in  Books > Computers & Internet > Computer Science > Software Engineering

Inside This Book (learn more)
First Sentence:
To keep with the tradition, our first program in Lua just prints "Hello World": print("Hello World") Read the first page
Key Phrases - Capitalized Phrases (CAPs): (learn more)
Jon Bentley, Literate Programming, More Programming Pearls
New!
Books on Related Topics | Concordance | Text Stats
Browse Sample Pages:
Front Cover | Table of Contents | First Pages | Index | Back Cover | Surprise Me!
Search Inside This Book:



Books on Related Topics (learn more)
 
 

What Do Customers Ultimately Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
Check the boxes next to the tags you consider relevant or enter your own tags in the field below.
(14)

Your tags: Add your first tag
 
Help others find this product — tag it for Amazon search
Roberto Ierusalimschy suggested this product show on searches for "game scripting". What do you suggest?

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

 

Customer Reviews

25 Reviews
5 star:
 (20)
4 star:
 (4)
3 star:
 (1)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
4.8 out of 5 stars (25 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
73 of 77 people found the following review helpful:
5.0 out of 5 stars Let the revolution begin, December 16, 2003
By André Carregal (Rio de Janeiro, RJ Brasil) - See all my reviews
This review is from: Programming In Lua (Paperback)
The Lua programming Language has been around for a while but this book by Roberto Ierusalimschy will be a mark in its history. The book managed to surpass every expectation I had for it, and I was eager! From someone with no Lua knowledge to those with Lua klocs in their backs, this book will be a great companion in a nice to read trip down the Lua 5.0 lane.

The book begins with the basic Lua elements and structures and then advances through control structures, functions, iterators and coroutines. Iterators and coroutines are one of those language features that may confuse the first timers, but the author manages to show the concepts and inter relations between them in a way that clarified the issues even for a seasoned Lua programmer. Alas, make no mistake, the whole first part is totally worthwhile for non beginners.

The second part of the book shows one of Lua biggest assets: tables and metatables. I've seen people sneer at Lua at first glance and then convert themselves to Lua evangelists simply for the features of tables and metatables. The author does his magic and makes a whole set of apparently complex concepts flow by the reader as fluid and logical as they can be.

By the way, fluency is arguably one of the major benefits of this book. The reader is taken from substrate to substrate of the Lua way of life without even taking notice. Every end of chapter left me with the satisfaction of having been presented with one more facet of Lua and with the tranquility that everything was falling in place at the right timing.

After tables and metatables, the book presents the concepts of Packages and Object Orientation in Lua. If you had any doubt ever that Lua was able to sustain "real" Modular/OO programming, be prepared to replace your dogmas. The book not only clarifies how to do it in Lua but also shows how easy and clear the coding gets.

The author ends the second part of the book with a great chapter on Weak Tables. I have to admit that I was somewhat refractory to Weak Tables before I read this book, but after this single chapter I was converted. May the name "weak" not influence your judgment on those Weak Tables. They are great, and the book showed more about them than I was expecting.

The third part of the book focuses on the standard libraries. Those would be the Table, String, I/O, Operating System and Debug libraries. Instead of repeating the contents of the Lua reference manual, the author manages to show lots of new information about the libraries by the use of examples and clear explanations. There are some points in Lua that can indeed be quite idiosyncratic at a glance, but this book is more than enough to clarify every one of them.

The fourth and last part of the book brings us the Lua C API. For the beginner Lua programmer this part will probably be skipped, but for the average programmer and most of all for the hardcore Lua explorer, this part will be pure delight. C programming is not for the faint of heart, but having a Lua interface for your C library is akin to the jackpot of embedded languages in my opinion.

This part of the book shows that the task of wrapping C code for Lua is not only feasible, but easily done once you grasp the fundamentals. Have one thing in mind, this was no small task for the author. Describing such an plethora of resources and how to use them in six chapters demands a clear yet straight to the point approach, and once again the book shines through.

Step by step the author shows how to deal with the Stack, to get arguments from and return values back to Lua, to handle tables (even those big ones), to call Lua functions from C code, to call C functions from Lua code, to handle strings, to handle state (using the registry, references and upvalues), and last but not least to use userdata types and metatables in C.

The last chapter of the book brings two examples of the use of the C API, one offers a directory iterator and the other a really nice example of binding an existent library (expat) for Lua use. Lots of my questions on the C API were dismissed with those two examples.

I should also reserve a praise for the book index. Not only I've found it complete but it is easy to understand some details of the Lua structure only by glancing at the index pages.

Conclusion

Being one of the first readers of this book was not only a great honor but also a great surprise. As a Lua old timer, I wasn't expecting to be presented to so many novelties, subtleties and jewels of programming in almost every chapter. Was I wrong...

If you have not seen Lua until now, this book is THE starting point.

If you are acquainted with other versions of Lua but have not studied version 5.0, this book is a great shortcut for your new endeavors.

Finally, if you think Lua is your native language and no book could teach you something worthwhile, think again. I was grateful I didn't skip not even one paragraph.

We've got the language. We've got the book. Let the revolution begin... :o)

Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
28 of 29 people found the following review helpful:
5.0 out of 5 stars A valuable multi-level book, February 19, 2004
By Enrico Colombini (Collebeato, Italy) - See all my reviews
This review is from: Programming In Lua (Paperback)
Lua is a free scripting language with an interesting development history. It is a language that is gaining wider acceptance thanks to small size, readable syntax, expressive power, efficiency, ANSI C portability and easy two-way integration with C and C++. It is also useful as a data-description language that can be tailored to one's needs.

Written by the chief architect of the language, this book is aimed at programmers whishing to approach or to better understand Lua and the (often unsuspected) capabilities offered by a fully dynamic language.

Despite its deceptively small size (260 pages) and a plain, readable style with an eye-resting typesetting, "Programming in Lua" packs an impressive amount of information peppered with small, clear code examples to help digesting it; it reminds me of my favorite programming book: the K&R (Kernighan and Ritchie's "The C programming language"). It is a multi-level book that always gives something new at every reading.

Rather than offer a catalogue of functions (left to the downloadable reference manual), the book's four sections introduce capabilities, concepts and interesting techniques that may surprise programmers used to static languages.

The first section is devoted to the language itself, including not-so-common subjects like dynamic typing, multiple results, first-class functions, closures, iterators and coroutines. The following section shows how to build all sorts of data structures, from simple arrays and lists to packages and objects, using Lua's "tables" and the powerful idea of "metatables" that makes the language easily customizable.
The third section introduces the standard libraries (they are actually optional, e.g. in microcontroller applications) with special emphasis on the simple but versatile pattern matching capabilities.

The fourth and last section is different: aimed at system programmers, it explains in detail how to interface Lua and C, both to add new functions to Lua and to use Lua inside a C program (possibly called from programs written in other languages).

"Programming in Lua" covers version 5.0 of the language, which is now mature and stable. I am using Lua both as a general-purpose 'light' language for system tasks or small programs, and as an embedded language inside C++ applications: the combined power of the two languages is impressive. I liked this book a lot, I learned much from it and I've done it the honor of a place besides my well-thumbed K&R.

Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
20 of 20 people found the following review helpful:
5.0 out of 5 stars Excellent book, March 4, 2004
By Kurt Jung (Michigan, USA) - See all my reviews
This review is from: Programming In Lua (Paperback)
Lua is a gem among programming languages. Its designers have commendably placed a high value on keeping the language small, readable and portable. The diminutive size and simple syntax of Lua, however, belie a very rich, highly factored and stable architecture. It is a fun language in which to program. Lua dovetails beautifully with lower level languages by means of a C interface, and its drum tight language processor and libraries are right at home in event-driven graphical applications as well as console programs.

The excellent book "Programming in Lua" by Roberto Ierusalimschy provides developers with a broad summary of the language. The author includes a myriad of small examples, each of which is well focused and easily grasped. Different solutions to a given problem are often accompanied by benchmark figures. Prof. Ierusalimschy has an educator's gift for finding the appropriate level at which to write, and readers will appreciate the conversational nature of his writing. Unlike many programming language books, "Programming in Lua" has a strong content-to-fluff ratio throughout.

The book provides valuable explanations of language and library features which even the careful reader of the Lua reference manual might miss. In addition, over twenty C library entry points are discussed (and, thankfully, indexed) which are not mentioned in the reference manual.

It is hard to conceive of a software project which would not benefit from using Lua, both as an embedded component and as a standalone interpreter of scripts. The book "Programming in Lua" is valuable for anyone with an interest in this lovely language.

Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)


Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews

5.0 out of 5 stars Go Roberto!
Buy it. And buy the Lua Reference Manual.

Buy them both. Do it now.

And buy extras to give away... like candy at a parade. Read more
Published 1 month ago by Phoenix Sol

5.0 out of 5 stars A thorough tour of the language
Significantly more than just a tutorial, this book dives deeper than the surface of the Lua language and shows you how and why things work as well. Read more
Published 2 months ago by R. F. Smith

4.0 out of 5 stars Not just a reprint
In Programming in Lua, Second Edition Roberto does a very good job of balancing the introduction of the language to the new Lua programmer, while keeping it interesting for the... Read more
Published 5 months ago by Jason L. Shiffer

5.0 out of 5 stars Lua will have no secrets...
I think this book is a "must have" if you are involved in Lua scripting. It covers almost every aspect of Lua programming from basics to advanced topics. Read more
Published 7 months ago by Marco Lazzeri

5.0 out of 5 stars Excellent Language Book
This book is very approachable and has a clear, concise writing style. It not only teaches the language, but also covers many interesting computer science topics along the way and... Read more
Published 8 months ago by Michael Lore

4.0 out of 5 stars Great introduction to Lua
Lua isn't a complicated language, honestly. If you're coming at it from another language, especially ones with simpler syntaxes like PHP or VB, you'll feel right at home. Read more
Published 8 months ago by Evan Sims

4.0 out of 5 stars Great book, but needs slight improvement
The information in the book is clear, easy to understand, and worth reading. The formatting of the text, the fonts used, and the overall style of the book is lacking. Read more
Published 12 months ago by Christopher A. Ogden

5.0 out of 5 stars Great book for learning the Lua language.
One of the best programing language books I have read. If only the programing guides for other languages could be this clear and concise.
Published 17 months ago by Randall E. Barker

5.0 out of 5 stars Good PIL book
Good examples, suggestions, and notes. Is a must have for any one looking to program in Lua.
Published 19 months ago by ms13sp

3.0 out of 5 stars I was not impressed
Naming this language after the moon is ironically apropos, as many of its lunatic creator's cognitive processes seem to randomly scramble themselves according to the phase of said... Read more
Published 20 months ago by orangekay

Only search this product's reviews



Customer Discussions

 Beta (What's this?)
New! See all customer communities, and bookmark your communities to keep track of them.
This product's forum (0 discussions)
  Discussion Replies Latest Post
  No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
  [Cancel]


   


Product Information from the Amapedia Community

Beta (What's this?)


Look for Similar Items by Category


Light It Up

Shop for sconces

Add light and beauty to your home with sconces from the Lighting & Electrical Store. Shop our extensive selection of indoor and outdoor fixtures.

Shop all sconces

 

Big Savings in Books

Bargain Books
Find great titles at fantastic prices in our Bargain Books Store.
 

Buy Three Books, Get a Fourth Free

4-for-3 Books
Order any four eligible books under $10 and get the lowest-price book free in our 4-for-3 Books Store. See more details.
 

Get a Grip

Shop for Wrenches
Quality wrenches are designed to hold and turn nuts, bolts, cap screws, and plugs with steady and safe leverage.

Shop all wrenches

 

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Where's My Stuff?

Shipping & Returns

Need Help?

Your Recent History

  (What's this?)
You have no recently viewed items or searches.

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.

Look to the right column to find helpful suggestions for your shopping session.

Continue shopping: Top Sellers

Conditions of Use | Privacy Notice © 1996-2009, Amazon.com, Inc. or its affiliates