Lua is an embeddable scripting language originally developed at Tecgraf, PUCRio in 1993 and now widely used in the interactive entertainment industry1. Its main goals are to be simple, efficient, portable and lightweight. The objective of this project was to improve the performance of the Lua programming language interpreter by adding a just-in-time (JIT) compiler to the standard run-time environment.
Although it is among the fastest scripting languages, Lua is still approximately a factor of 20 slower than C in the majority of benchmarks [?, ?]. There is still plenty of room for improvement. Admittedly, the performance of the standard Lua virtual machine (VM) is adequate for tasks such as configuration or for use as a ‘glue’ language, but high performance and efficiency are important in games and interactive applications
Si vous rencontrez des erreurs liées au téléchargement de votre document, n'hésitez pas à nous contacter.
Télécharger Lua Tutorial programming language
Formation adaptées à votre besoins, tous les livres pdf et cours LUA , cours développement LUA , projet de fin d'études.., peuvent être lus en ligne et vous pouvez télécharger la plupart d'entre eux directement sur votre ordinateur, liseuse, tablette ou smartphone sous divers formats : DOC, PDF, RAR, ZIP.., vous pouvez maintenant télécharger gratuitement ce document -Lua Tutorial programming language-, pour améliorer vos connaissances en développement LUA, tutoriel Lua, manuel Lua français, quel langage de programmation pour une application mobile ?, cours de base pour apprendre a programmer avec lua ? plus de rapport de stage et projet de fin d'étude en pdf. N'hésitez pas à télécharger nos didacticiels et nos documents guides et à apprendre la joie de l'apprentissage libre.
Coercion of Types :
String and number types are automatically converted between each other: whenever a string is used in a context where a number is expected, the string is converted into a number, and vice versa. An error is raised if a string cannot be converted into a number, as demonstrated in the interactive Lua session in Figure 1.3. This behaviour must be retained by the JIT compiler to ensure consistent execution of arbitrary Lua programs.
Metamethods
Another powerful concept in Lua is the alteration of the semantics for userdata and table accesses through using metamethods. Metamethods allow programs to overload certain operations on tables and userdata objects. Each overloaded object has a metatable of functions (metamethods) associated with it. The metamethods are associated with events, which occur when operations such as addition and comparisons are performed on the object. This can even be used to implement object-oriented mechanisms [?].
Libraries
Areas of Optimisation
Submodules and Packages :
What About Lua? :
Scripting
Scripting language x dynamic language ● scripting emphasizes inter-language communication ● Program written in two languages ● a scripting language and a system language ● System language implements the hard parts of the application ● algorithms, data structures ● little change ● Scripting glues together the hard parts ● flexible, easy to change
Lua is fast :
Lua is embeddable :
Lua is powerful (and simple) :
Lua provides meta-mechanisms for implementing classes and inheritance. Lua's meta-mechanisms bring an economy of concepts and keep the language small, while allowing the semantics to be extended in unconventional ways.
What is LuaSDL :
LuaSDL is a glue/abstraction layer of Lua on SDL & Ext Libs (SDL_Mixer, SDL_Image, SDL_net, and SDL_ttf). This architecture allows Game content developers to use SDL interfaces in Lua scripts. Below figure depicts the S/W data flow in Lua Abstraction Framework. There are various components which executes the control flow from native SDL to Lua Abstraction layer as follows: 1. Script Game Launcher: It is responsible to execute the Lua Script Game. 2. Script game contents: It includes all the game resources. Game script calls the APIs of Lua Abstraction layer & so provides similar functionality to end user. 3. Lua Abstraction Layer: This layer is basically wrapper over the corresponding native Library. Like for SDL & SDL ext Libs, it has Lua based data types & APIs support which has interaction with respective native data types & APIs. 4. Native SDL & SDL ext Libs: Framework consists of both Native & Lua Abstraction layer to provide integrated solution for product development.
Conclusions :
Throw exceptions in situations which usually can't be handled locally by parent stack frame ● Use try-except construct for exception handling ● Throw tables instead of strings ● Enumerate errors as part of API ● Fixing pcall/coroutine problem is important ● Standard interface for inheritance testing would be useful