Limited pattern-matching support, although the included one is still quite powerful.See also this message and follow-ups for a good summary of what is already supported and what modifications may be required for string.* functions. No Unicode support (at the very least you don't get string.len and pattern matching functions to recognize Unicode characters) there is a binding to ICU library that implements full Unicode support.I have not had many issues caused by uninitialized globals, but still put this one into the "bad" category as I once made a mistake of calling a variable "next" and not localizing it, which caused an issue with an iterator in a completely different module as it overwrote the next function used with iterators. There is a strict module that requires all global variables to be initialized. Global scoping by default (this has been partially addressed in Lua 5.2, which has no globals).finally constructs may be cleaner and simpler to read in many cases. The combination of pcall and error is quite powerful, especially given that error can return anything (for example, a table) rather than just a string, but having catch. Limited error handling support (using pcall and xpcall), although some may argue that it is sufficient and just needs some syntactic sugar and more feature support (like deterministic finalizers).This is the other side of having a compact and portable core and is well compensated by having LuaRocks and libraries like Penlight. Smaller than expected number of components that are available "out of the box" some people see this as "batteries not included".Powerful heterogeneous tables that store values of any type (except nil) and can be indexed by values of any type (except nil).Incremental garbage collector that has low latency, no additional memory cost, little implementation complexity, and support for weak tables.Native support for coroutines to implement iterators and non-preemptive multi-threading.Integrated interpreter: just run lua from the command line.I still remember using early versions of Philippe Kahn's fast and elegant Turbo Pascal IDE. Lua has borrowed most of its control syntax from Modula, the descendent of Pascal, which was widely used in education as an introductory language. Clean and simple syntax suitable for beginners and accessible to non-programmers.Between the excellent documentation, the wiki, the mailing list, and StackOverflow, I didn't have any issues finding answers to my questions. Well documented: reference manual, book, wiki, 6-page short reference and more.replaced shootout results that are no longer available with benchmarksgame. Sufficiently fast: performs well comparing to other languages and has a JIT compiler that noticeably improves performance on many tasks those who may still be not satisfied with the performance, can implement critical parts in C and, given the ease of integration with C, still benefit from other good aspects.Embedded and extensible language that provides a straightforward interface to/from C/C++.You can see it running on almost anything from microcontrollers and Lego Minstorms NXT, to game engines, to mobile toolkits, to game consoles, to a browser (translated to JavaScript). Portable: builds on any platform with an ANSI C compiler.Small: 20000 lines of C code that can be built into a 182K executable interpreter (under Linux).It is far from being comprehensive and some aspects of the language are not covered (for example, math and string libraries), but it captures the gist of my experience with the language. JavaScript, and Lua Gotchas), but I found that some of the features that tripped me or that I cared about were not listed, so I put together my own list. I have come across several detailed lists that mention good and not-so-good parts of Lua (for example, Lua benefits, why Lua, why Lua is not more widely used, advantages of Lua, Lua good/bad, Lua vs. I have done different types of projects in Lua: a remote debugger ( MobDebug), extending a Lua IDE ( ZeroBrane Studio), a mobile app ( LuaRemote), several educational scripts ( EduPack), and a demo of drawing on browser canvas with Lua. I have used various languages over the years - Perl ( and other projects, including my current consulting work), C ( a DHCP/DNS server for Arduino and a ping-pong juggling robot), JavaScript ( experiments with Google Maps and canvas), MATLAB ( ping-pong juggling robot), and others, from Turbo Pascal to F# - and it was interesting to see how Lua compares to the other languages I've worked with. I have been programming in Lua for about 9 months and it seemed like a good time to pause and reflect on my experience with it.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |