Question 1. What Is Lua?
Lua is a lightweight multi-paradigm programming language designed primarily for embedded systems and clients. Lua is cross-platform since it is written in ANSI C, and has a relatively simple C API.
Question 2. Who Is/are The Founder Of Lua?
Lua was created in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes, members of the Computer Graphics Technology Group (Tecgraf) at the Pontiʸcal Cath of Rio de Janeiro, in Brazil.
Question 3. Is Lua Free Software?
Yes, Lua is freely available for any purpose, including commercial purposes, at absolutely no cost, and using it requires no paperwork.
Question 4. Is Lua Compatible With Gpl Software?
Yes. Lua is distributed under the terms of the very liberal and well-known MIT license, which is compatible with GPL and is approved by the Open Source Initiative.
Question 5. Is There A Public Revision Control Repository?
No, there is no publicly available repository of Lua development code. Read this explanation. If you want to see a preview of what is coming in the next version, you’ll have to wait until a work version is available.
Question 6. What Are The Advantages And Disadvantages Of Using Lua?
Lua has a couple of advantages:
- It’s lightweight: It doesnt require much storage and is easy to learn
- It’s ‘quite fast’: It is actually about as fast as python
- It’s fully written in C: You can easly manipulate lua if you know C
- Lua also has a great documentation.
- There’s LuaJIT!
Lua has a couple of disadvantages aswell:
- It’s lightweight: If you want python style regex, you’ll have to code your own, or download a library.
- It has a small community.
Question 7. Do You Accept Patches?
We encourage discussions based on tested code solutions for problems and enhancements, but we never incorporate third-party code verbatim. We always try to understand the issue and the proposed solution and then, if we choose to address the issue, we provide our own code.
Question 8. Is There A Mailing List For Lua?
Yes, a friendly and active one called lua-l. Everyone is welcome. Read all about it here.
Question 9. What Make Lua Distinct From Other Languages?
Lua provides a set of unique features that makes it distinct from other languages. These include
- Free and open
Question 10. What Are Some Use Of Lua?
Lua is mainly use for following purpose
- Game Programming
- Scripting in Standalone Applications
- Scripting in Web
- Extensions and add-ons for databases like MySQL Proxy and MySQL WorkBench
- Security systems like Intrusion Detection System.
Question 11. What Are The Advantages Of Using Lua With C?
It’s great if you know what you’re using Lua for. Lua is a scripting language commonly used in games like Multi Theft Auto or Garry’s Mod.
You don’t need it unless you’re planning on implementing a plugin/resource system or interested in easy modding. It’s really easy to set up and really easy to use for its purpose.
Question 12. Can Or Will Lua Be Used As A Web Programming
Yes, given its a general interpreted programming language just like Python or Ruby, but with a smaller library and a small community.
At this point I would say: do it if you want to experiment, but not for professional stuff.
Question 13. What Is Luajit?
LuaJIT is a Just-In-Time Compiler for the Lua programming language. LuaJIT offers more performance, at the expense of portability. On the supported OS’s (all popular operating systems based on x86 or x64 CPUs (Windows, Mac OSX, Linux, …), ARM based embedded devices (Android, iOS) and PPC/e500v2 CPUs) it offers an API- and ABI-compatible drop-in replacement for the standard Lua interpreter.
Question 14. What Makes Luajit Faster Than Lua?
Firstly, LuaJIT has a faster baseline interpreter. Even without the JIT, LuaJIT is already faster than baseline Lua for three reasons:
The interpreter uses a custom bytecode format. The Lua 5.1 format needs a bit more bit ʸddling to decode an instruction, but LuaJIT’s format only uses ʸelds that are multiples of 1 byte. This makes decoding instructions faster. Since decoding has to be done for every single instruction, a simpler format directly translates into a faster interpreter. (By how much depends on the complexity of each instruction, though.)
It uses direct dispatch. The standard way of implementing an interpreter in C is to use a loop and a big `switch` statement at the top which then dispatches to the code that executes the instruction. A faster way is to use a table of code labels, have each instruction decode the next instruction, and directly jump to the label for the next instruction based on the opcode of the following instruction. If you want to do this in C you need a special GNU/Clang instruction. You cannot do this in ANSI C, which standard Lua aims to.
LuaJIT’s interpreter is written in assembly. This makes matters quite a bit more complicated (and obviously unportable), but opens the potential to outsmart the compiler. For this speciʸc use case hand-rolled assembly indeed beats a compiler in almost all cases. Google’s Dalvik VM interpreter is also written in assembly, and I believe so is JVM’s.
Question 15. What Are The Pros And Cons Of Lua Vs. Python And Vice Versa?
Following are the pros/Advantages and cons/disadvantage of Lua vs Python
- Lua is off-the-charts portable. It’s by far the most portable language I’ve ever seen, maybe even the most portable program.
- What I mean by this isn’t that Lua programs are portable (they’re not, compared to Java), but Lua itself is.
- Just recently I built Lua on an IBM iSeries, with zero changes to the source code, I just compiled each Lua source ʸle with the IBM ILE C compiler.
- Compare that to getting say, Python building on some unknown UNIX, let alone a completely different OS like IBM i (OS/400).
- Lua is very simple, easy to port to a new platform, easy to integrate with C on that platform. It’s a nice enough language, but nothing special, but it’s portability is special.
- If the platform has an ANSI C compiler (and they pretty much all do, I can only think of a couple that do not), then you can almost certainly build Lua, that’s very cool indeed.
Question 16. Who Uses Lua?
Lua is used in many products and projects around the world, including several well-known games. The full list is too long for us to keep track.
Question 17. How Do I Build Lua In Windows And Other Systems?
This depends on your compiler. Most compilers in these platforms require that you create “project” files. You’ll need to create projects (or whatever your compiler uses) for building the library, the interpreter, and the compiler. The sources are all in the src directory. If you don’t have the time or the inclination to compile Lua yourself, get a binary from LuaBinaries.
Question 18. What Changes Will The Next Version Bring?
Lua 5.3 was released recently. For a preview of what is coming in the next version, try a work version when available.
If you’re concerned with incompatibilities, you shouldn’t, because we make every effort to avoid introducing any incompatibilities. When incompatibilities are unavoidable, previous code is usually supported unmodified, possibly by building Lua with a suitable compilation flag.
Python Interview Questions
HTML 5 Interview Questions
HTML 5 Tutorial
ASP.NET Interview Questions
Oracle 11g Interview Questions
C & Data Structures Interview Questions
Python Interview Questions
Oracle 11g Tutorial
Basic Programming Interview Questions
Six Sigma Tutorial
Six Sigma Interview Questions
HTML 5 Interview Questions