• Complain

Roberto Ierusalimschy - Programming in Lua, fourth edition

Here you can read online Roberto Ierusalimschy - Programming in Lua, fourth edition full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2016, publisher: Lua.Org, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Roberto Ierusalimschy Programming in Lua, fourth edition
  • Book:
    Programming in Lua, fourth edition
  • Author:
  • Publisher:
    Lua.Org
  • Genre:
  • Year:
    2016
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Programming in Lua, fourth edition: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Programming in Lua, fourth edition" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Lua is spreading more and more throughout different areas of software, from embedded systems and mobile devices to the Web and the Internet of Things. Besides, it has a major role in the game industry, where knowledge of Lua has become an indisputable asset. Lua is the language of choice for anyone who needs a scripting language that is simple, efficient, extensible, portable, and free. Programming in Lua is the official book about the language, providing a solid base to 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. The book is the main source of programming patterns for Lua, with numerous code examples that help the reader to make the most of Luas flexibility and powerful mechanisms. 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 Fourth Edition updates the book to Lua 5.3 and marks a complete reorganization of the text. Building on his many years of experience teaching Lua, Roberto has restructured the book to present the material in a growing order of complexity, allowing the reader to better absorb the character of the language.

Roberto Ierusalimschy: author's other books


Who wrote Programming in Lua, fourth edition? Find out the surname, the name of the author of the book and a list of all author's works by series.

Programming in Lua, fourth edition — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Programming in Lua, fourth edition" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Programming in Lua, fourth edition
Roberto Ierusalimschy
PUC-Rio

Copyright 2016, 2003 Roberto Ierusalimschy


About the Book

When Waldemar, Luiz,and I started the development of Lua,back in 1993,we could hardly imagine that it would spread as it did.Started as an in-house language for two specific projects,currently Lua is widely used in all areas that can benefit from asimple, extensible, portable, and efficient scripting language,such as embedded systems,mobile devices,the Internet of Things,and, of course, games.

We designed Lua, from the beginning,to be integrated with software written in C/C++and other conventional languages.This integration brings many benefits.Lua is a small and simple language,partly because it does not try to dowhat C is already good for,such as sheer performanceand interface with third-party software.Lua relies on C for these tasks.What Lua does offer is what C is not good for:a good distance from the hardware,dynamic structures, no redundancies,and ease of testing and debugging.For these goals, Lua has a safe environment,automatic memory management,and good facilities for handling strings and otherkinds of data with dynamic size.

Part of the power of Lua comes from its libraries.This is not by chance.After all,one of the main strengths of Lua is its extensibility.Many features contribute to this strength.Dynamic typing allows a great degree of polymorphism.Automatic memory management simplifies interfaces,because there is no need to decide who is responsiblefor allocating and deallocating memoryor how to handle overflows.First-class functions allowa high degree of parameterization,making functions more versatile.

More than an extensible language,Lua is also a glue language.Lua supports a component-based approach to software development,where we create an application by gluing togetherexisting high-level components.These components are written in a compiled,statically-typed language, such as C or C++;Lua is the glue that we use to compose and connect these components.Usually, the components (or objects) represent more concrete,low-level concepts (such as widgets and data structures)that are not subject to many changes during program development,and that take the bulk of the CPU time of the final program.Lua gives the final shape of the application,which will probably change a lotduring the life cycle of the product.We can use Lua not only to glue components,but also to adapt and reshape them,and to create completely new components.

Of course, Lua is not the only scripting language around.There are other languages that you can use for more or lessthe same purposes.Nevertheless, Lua offers a set of features that makes ityour best choice for many tasks and gives it a unique profile:

Extensibility:

Luas extensibility is so remarkable that many peopleregard Lua not as a language,but as a kit for building domain-specific languages.We designed Lua from scratch to be extended,both through Lua code and through external C code.As a proof of concept,Lua implements most of its own basic functionalitythrough external libraries.It is really easy to interface Lua withexternal languages likeC/C++, Java, C#, and Python.

Simplicity:

Lua is a simple and small language.It has few (but powerful) concepts.This simplicity makes Lua easy to learnand contributes to its small size.(Its Linux 64-bit executable,including all standard libraries,has 220 KB.)

Efficiency:

Lua has a quite efficient implementation.Independent benchmarks show Lua asone of the fastest languages in the realm ofscripting languages.

Portability:

When we talk about portability,we are talking about running Luaon all platforms we have ever heard about:all flavors of UNIX (Linux, FreeBSD, etc.)Windows,Android,iOS,OS X,IBM mainframes,game consoles (PlayStation, Xbox, Wii, etc.),microcontrollers (Arduino, etc.),and many more.The source code for each of these platformsis virtually the same.Lua does not use conditional compilationto adapt its code to different machines;instead, it sticks to the standard ISO (ANSI) C.This way,you do not usually need to adapt it to a new environment:if you have an ISO C compiler,you just have to compile Lua,out of the box.

Audience

This book does not assume any prior knowledge of Lua orany specific programming languageexcept 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 Luas C APIto 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 thatLua is an independent language adapted for a particular domain.For instance,many developers of plug-ins for Lightroom do not knowabout other uses of the language;Nmap users tend to think of Lua as the languageof the Nmap Scripting Engine;many players of World of Warcraftregard 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 hereapply 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 andother 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 onthe 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 Luato create interfaces that are simple,easy to use, and well integrated with the language.

Book Structure

This editionadds new material and examples in many areas,including sandboxing, coroutines,date and time manipulation,in addition to the new material related to version 5.3:integers, bitwise operations, unsigned integers, etc.

More importantly,this edition marks a major restructuring of the text.Instead of organizing the materialaround the language(e.g., with separate chapters for each library),I tried to organize the material aroundcommon themes in programming.That organization allows the bookto better follow an order of increasing complexity,with simple themes coming first.That order came from experience teachingcourses about the language;in particular,I think this new organization fitsthe book better as a didactic resourcefor courses involving Lua.

As the previous editions,this one is organized in four parts,each with around nine chapters.However, the parts have a quite new character.

The first partcovers the basics of the language(and it is fittingly named The Basics).It is organized around the main types of values in Lua:numbers, strings, tables, and functions.It also covers basic I/O andgives an overview of the syntax of the language.

The second part,called Real Programming,covers more advanced topics thatyou can expect to find in other similar languages,such as closures, pattern matching,date and time manipulation,data structures,modules, and error handling.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Programming in Lua, fourth edition»

Look at similar books to Programming in Lua, fourth edition. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Programming in Lua, fourth edition»

Discussion, reviews of the book Programming in Lua, fourth edition and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.