Lua

Programming in Lua. 4 Ed - Roberto Ierusalimschy

2016
Lua
english

 This book does not assume any prior knowledge of Lua or any specific programming language —except for its last part, which discusses the Lua API with C. However, it assumes the knowledge of some basic programming concepts, in particular variables and assignment, control structures, functions and parameters, recursion, streams and files, and basic data structures.

 Lua users typically fall into three broad groups: those that use Lua already embedded in an application program, those that use Lua stand alone, and those that use Lua and C together. This book has much to offer to all these groups.

 Many people use Lua embedded in an application program, such as Adobe Lightroom, Nmap, or World of Warcraft. These applications use Lua's C API to register new functions, to create new types, and to change the behavior of some language operations, configuring Lua for their specific domains. Often, the users of such applications do not even know that Lua is an independent language adapted for a particular domain. For instance, many developers of plug-ins for Lightroom do not know about other uses of the language; Nmap users tend to think of Lua as the language of the Nmap Scripting Engine; many players of World of Warcraft regard Lua as a language exclusive to that game. Despite these different worlds, the core language is still the same, and the programming techniques you will learn here apply everywhere.

 Lua is useful also as a stand-alone language, not only for text processing and one-shot little programs, but for medium-to-large projects, too. For such uses, the main functionality of Lua comes from libraries. The standard libraries, for instance, offer pattern matching and other functions for string handling. As Lua has improved its support for libraries, there has been a proliferation of external packages. LuaRocks, a deployment and management system for Lua modules, passed one thousand modules in 2015, covering all sorts of domains.

 Finally, there are those programmers that work on the other side of the bench, writing applications that use Lua as a C library. Those people will program more in C than in Lua, although they need a good understanding of Lua to create interfaces that are simple, easy to use, and well integrated with the language.

Go to >

Программирование на языке Lua. 3 изд - Р. Иерузалимски

2013
Lua
русский

 Эта книга является обновленной и расширенной версией второго издания книги «Programming in Lua» (также известной как PiL 2). Хотя структура книги практически та же самая, это издание включает в себя изрядное количество нового материала.

 Во-первых, я обновил всю книгу до Lua 5.2. Особую значимость представляет глава об окружениях, которая была практически полностью переписана. Я также переписал несколько примеров, чтобы показать преимущества от использования новых возможностей, предоставляемых Lua 5.2. Тем не менее, я четко обозначил отличия от Lua 5.1, поэтому вы можете использовать книгу и для этой версии языка.

 Во-вторых, что более важно, я добавил упражнения во все главы книги. Эти упражнения варьируются от простых вопросов о языке до небольших полноценных проектов. Некоторые примеры иллюстрируют важные аспекты программирования на Lua и так же важны, как примеры, которые расширяют ваш набор полезных приемов.

 Как и в случае с первым и вторым изданиями «Programming in Lua», мы опубликовали это третье издание самостоятельно. Несмотря на ограниченные возможности распространения, этот подход обладает рядом преимуществ: мы сохраняем полный контроль над содержимым книги; мы сохраняем все права на предложение книги в других формах; мы свободны выбирать, когда выпустить следующее издание; мы можем быть уверены, что выпуск данной книги не будет прекращен.

Go to >

Programming in Lua. 3 Ed - Roberto Ierusalimschy

2013
Lua
english

 This book is an updated and expanded version of the second edition of Programming in Lua (also known as the PiL 2 book). Although the book structure is virtually the same, this new edition has substantial new material.

 First, I have updated the whole book to Lua 5.2. Of particular relevance is the chapter about environments, which was mostly rewritten. I also rewrote several examples to show how to benefit from the new features offered by Lua 5.2. Nevertheless, I clearly marked the differences from Lua 5.1, so you can use the book for that version too.

 Second, and more important, I have added exercises to all chapters of the book. These exercises range from simple questions about the language to full small-size projects. Several exercises illustrate important aspects of programming in Lua and are as important as the examples to expand your toolbox of useful techniques.

 As we did with the first and second editions of Programming in Lua, we selfpublished this third edition. Despite the limited marketing, this avenue brings several benefits: we have total control over the book contents; we keep the full rights to offer the book in other forms; we have freedom to choose when to release another edition; and we can ensure that the book does not go out of print.

Go to >