Programming in Lua 2nd Edition 131
Andre Carregal writes "In the second edition of Programming in Lua Roberto Ierusalimschy presents the Lua programming Language in a simple yet precise format for both novice and advanced programmers." Read the rest of Andre's review.
Programming in Lua, 2nd Edition | |
author | Roberto Ierusalimschy |
pages | 328 |
publisher | Lua.Org; 2nd edition (March 5, 2006) |
rating | 10 |
reviewer | Andre Carregal |
ISBN | 8590379825 |
summary | Shows how Lua is the language of choice for anyone who needs a scripting language that is simple, efficient, extensible, portable, and free. |
The Lua programming language has been around for more than 10 years, but only recently has it started to appear on the mainstream radar screens. It has evolved from a simple scripting language to a full-fledged solution for scripting and embedding. Lua is portable, fast and small, and the language of choice for applications as diverse as games, Web sites and robot controllers as the Lua Users Wiki and LuaForge will confirm.
Lua portability can be shown by the long list of operating systems it runs on, which includes not only Windows and Linux, but also small systems and mobile devices. The memory and CPU requirements for the runtime are really low, and Lua has been used in environments that most other scripting options would not dare go into.
One of the milestones of the history of Lua has been the release of the book Programming in Lua (a.k.a "PiL"), by Roberto Ierusalimschy, in 2003. This review is about the second edition of Programming in Lua, a.k.a. the "Blue PiL" due to the color of its cover.
Lua is free software and can be obtained from its site (www.lua.org). There you will also find the reference manual of the language and the full contents of the first edition of Programming in Lua.
As a disclaimer, let me say that I'm one of the technical reviewers of the book and I have been working with Lua since 1993, most of the time interacting with Roberto Ierusalimschy, even when not working in the same projects as him.
The second edition manages to surpass an already good book in various aspects. The "Blue PiL" presents not only the language itself, but also gives an excellent view of how one could see Lua as the foundation of solid scripting techniques. The original Programming in Lua was focused on Lua 5.0, while the second edition focuses on Lua 5.1. While the differences between Lua 5.0 and 5.1 are not radical, the newer version has a lot more to offer, both in terms of the modularity aspect and of language features. The second edition of Programming in Lua indicates clearly when some concept or detail relates only to a specific version of Lua, but most of the contents can be applied to both Lua versions.
Programming in Lua is oriented to both the novice programmer who wants to get a first feeling for Lua, and to the advanced Lua or C programmer who wants to use the full potential of the language. The book clearly separates the two aspects and indicates the sections that can be skipped for each reader profile. The author manages to keep a light and easily readable style during the whole book and the examples are simple and direct, making the flow of the reading quite pleasant. I can say that, even having some reasonable experience with Lua, I was surprised by a lot of details in the book. The "Blue PiL" is one of those books that you can read many times over, and each time you learn something new.
The "Blue PiL" starts with an overview of the Lua language and slowly evolves through the more advanced concepts and the features that make Lua such a unique language. Even though it's a relatively thin book, it goes from the starting concepts to the more sophisticated ones with a grace that is really rare to find. The one other book that comes to mind with an effect like this is the classical Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman, which says a lot.
The first part of the book presents the language and the basic features. In particular, concepts such as iterators, coroutines and closures are presented in a clear way, which is no small feat considering that many readers will be having contact with such concepts for the first time.
One of the strong points of Lua is its simplicity, but don't assume that this implies lack of power. An example of this balance is the table data structure, in fact the only data structure for Lua. Tables allow the construction of every other data structure (arrays, sets, bags etc) but also allows the use of sophisticated techniques such as metamethods, function environments, modules and object orientation.
In fact, instead of providing every feature one might want to use, Lua provides the meta mechanisms so you can create your own features, or use them as modules created by third parties. In order to explain the full power of these meta mechanisms the second part of the book takes the reader from the basic steps of creating a table and shows how each of the mechanisms can add features or help the usage of some advanced concepts.
As an example, the chapter on object-oriented programming not only shows how to use objects in Lua, but also how to think of objects as prototypes for other objects, and how to implement inheritance on such a model without using anything too fancy.
There are also chapters on the use of metatables (basically tables that define the behavior of other tables), the use of tables as function environments (a really powerful mechanism once understood), modules and finally weak tables. Weak tables allow the advanced use of memory resources in an automatic way, providing mechanisms for data structures that tend to be hard to implement in other languages, if even possible at all.
This slow but efficient presentation of concepts that, though complex, can be easily assimilated by the reader is a predominant aspect of Roberto's work. He is not only a skilled author but also knows how to present things in a way that a novice can grasp and an expert can master.
The third part of Programming in Lua covers all the language libraries (math, table, string, system, debug and I/O) in clear prose and shows that even with a small set of libraries Lua can pack a lot of power on a very small footprint.
Finally, the last part of the book is directed to programmers that want to use Lua to its full potential. Lua can be used as an extension language or as an embedded language, and knowing how to interact with the host language (C, C++, Java, Delphi etc.) is mandatory for that. The book presents the C API for Lua in the same progressive pace, but also manages to cover every ground needed so one can add Lua to a project without much pain, if any.
One important thing to note about the book is that it follows the same philosophy that guides the language, showing that simplicity and lightness has nothing to do with lack of power or coverage.
I really recommend this book to anyone interested in learning Lua, and also for those who already know how to use Lua but would like to fully master its way of thinking, the so called "Lua way" of doing things. The book has been considered by many as an excellent guide on programming, even if one is not interested in Lua in particular."
You can purchase Programming in Lua, 2nd Edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
As opposed to... (Score:2, Funny)
Of course, if you grew up with a last name like "Ierusalimschy", reading Perl aloud is probably pretty old hat for you. For that matter, so are APL and Brainf*ck.
Re:As opposed to... (Score:5, Funny)
Re: (Score:1)
Actually, to get that you would have to be cheating... badly.
Re: (Score:1)
Re: (Score:2)
Re: (Score:2, Insightful)
Re: (Score:2)
"We are not amused" is just a Monty Python way of saying "this is not funny". It was used in a sketch of Queen Victoria, who presumably referred to herself in plural. If you didn't recognize the line, please hand in your geek card on the way out ;)
However, I also have a (Finnish) name that's pretty incomprehensible to English speakers, so I feel qualified to note when people make fun of something on the basis that they don't understand it.
Re: (Score:1)
Ah. I'm one of those anti-geek-establishment geeks who isn't into Monty Python. But besides that, I think you're being overly sensitive. The guy's last name looks funny to the average Slashdot reader. So what? I didn't detect any viciousness in the jokes.
Re: (Score:2)
Perfect... (Score:2, Informative)
Re:Perfect... (Score:5, Interesting)
I really recommend this book to anyone interested in learning Lua, and also for those who already know how to use Lua but would like to fully master its way of thinking, the so called "Lua way" of doing things.
Every time I see one of these "Learn Language X in Your Spare Time" book reviews, I wonder, "Why another language?" Advancement of languages is good, and "new" languages like Ruby are great, but how many programming languages are we as a community going to produce? Like text editors, it would be better to focus on fewer targets and add features than keep coming up with new "my toolbox grew so big I created a compiler for it" languages.
Of course, I may just be trollish today. Hard to tell.
Re: (Score:2, Interesting)
Every time I see one of these "Learn Language X in Your Spare Time" book reviews, I wonder, "Why another language?" Advancement of languages is good, and "new" languages like Ruby are great, but how many programming languages are we as a community going to produce? Like text editors, it would be better to focus on fewer targets and add features than keep coming up with new "my toolbox grew so big I created a compiler for it" languages.
I think that what you say really does apply to a number of languages
Re: (Score:2)
"Because different people prefer different text editors" would be the o
languages as tools (Score:3, Interesting)
Any of these 'new language X' are written to tackle a particular problem set. Would you use perl or C do to string munging? Would you use perl or Fortran to do fast and heavy number crunching? Being aware of what languages are out there may save you time when you encounter a
Re:languages as tools (Score:4, Interesting)
Incredibly, there is a rather good 4th order Runge-Kutta ODE solver available in Perl. I used it once because I wanted something quick and dirty, and expected performance would be terrible, but when I later translated it into C++ I had to squeeze pretty hard to get more than a factor of two speed increase. And the difference between C++ and FORTRAN is less than a factor of two for most applications these days (although I do confess to missing FORTRAN's optimized exponentiation.)
Furthermore, with decent regex and string classes available for every language under the sun (except FORTRAN, of course...) there is less and less reason to prefer one language over another, and even less reason for people to go mad and write their own. And if you really need the performance of LAPACK in FORTRAN then you can call into it from C++ easily enough.
If one is writing applications, then it is very hard to beat C++, especially given the number of excellent cross-platform application frameworks (I'm currently very happy with wxWidgets, but have used Qt heavily in the past). For scripting one has a wide range of viable choices: perl, python, Java... These are all well-supported, have large user bases, and while they are unsuitable for serious application development for a number of reasons, they all do the sorts of things we want scripting languages to do: runtime optimization, garbage collection (admittedly broken in many JVMs, but working well in perl and python), and adequate cross-platform support.
So in this environment, new languages are more of an irritant than anything else, perhaps useful for their experimental value, but if you really want new features in perl or whatever, then the best way to get them there is to work on the development of that language, not re-capitulate everything with an almost-completely-but-not-quite-identically similar syntax. Given that perl 6 is near-as-damnit a new language anyway, this is a particularly auspicious time for such endeavours.
Re: (Score:3, Insightful)
Re: (Score:2)
Embedded languages certainly have their place--I've used perl as an embedded language in the past and am likely to use python in the future. But using rare languages is problematic--it requires that whoever maintains your code in future is familiar with the same languages you are, and it requires that debuggers support calls across rare language boundaries.
And while large languages do get bloated, they also get refactored, and from a community perspective we are far better off with people putting time into
Re: (Score:2)
I question the idea that programmers not knowing the language is much of an issue - for the most part, all languages use variations of the same C-like syntax with only a few break-aways such as Smalltalk, Lisp, or FORTH. Besides, there are plenty of prog
You make baby Splutty cry. (Score:1)
But oh well
Splut.
Re: (Score:2)
I have a feeling you're spouting cool-kid party line more than anything. Yeah, Perl has Java on memory consumption. But Java beats Perl [debian.org] hands down on speed. As for transparency, well, I guess there's no accounting for taste, but I think
Re: (Score:2)
Have you looked into FLTK? I confess I haven't looked at wxWidgets lately, but when I had to choose a free, cross-platform widget library a couple years ago, I decided FLTK was my best choice. I was a bit put off by its sluggish development, but I liked the API.
Re: (Score:2)
I looked at it many years ago, but it was just Not There in terms of the functionality I wanted. wxWidgets (wxWindows, in those days) wasn't ready for prime time either, which is why I went with Qt. I'm happy with wxWidgets as it stands today, and have enough invested in it to not want to change again.
Re: (Score:2)
Just like junk food is the most popular food in the US, junk programming languages are the most popular languages: cheap, widely available, and many people are "happy" with them. They also cause analogous problems: software obesity and software heart attacks.
Basically, your entire rant is just reiterating standard stereotypes about languages and just shows that you
Re: (Score:2)
Re:Perfect... (Score:5, Insightful)
The history of programming languages shows that this is a good way to kill a language. Languages are a delicate balance between enabling you to express things, and preventing you from expressing things. You can't just throw the kitchen sink in there and expect the result to be usable. People design new programming languages because they perceive limitations in the ones they already know, limitations that often can't just be overcome by adding features.
From a programmer's point of view, a good reason to learn a new language is to expand your mental horizons. It can be a passable substitute for actually studying computer science (which you clearly haven't done, if you're asking "why another language?") Don't just learn an array of similar languages, like Python and Ruby. If you already know a popular OO language, then learn a language like Scheme, ML, or Erlang, or if you really want some nerdy metaphorical hair on your chest, learn Haskell (although you might want to start with one of the others first). Then you'll understand "why another language".
Re: (Score:1)
I was thinking "why another scripting language", but I don't know bupkis about Lua. But the problem is one can only be truly fluent in a couple or four languages, at a time. Outside the few that I have the chance to maintain high levels of expertise in, code that I write in any ot
Re: (Score:2)
But I don't think anyone is arguing that you should learn Lua specifically just because it's there. Yo
Re: (Score:2)
You might learn Lua if you're looking for a lightweight embeddable scripting language, in which case it's one of the better choices available; or if you're working with one of the systems in which it's already embedded, in which case Lua is a foregone conclusion.
Okay, so you have me interested. Can you elaborate on just what an "embeddable scripting language" is? I mean, I have an idea, but go about it as if I have no clue. That will satisfy those that believe such.
And, just to let you know, I feel l
Re: (Score:2)
It's a language that can be integrated into an application at the source code level, so that the language becomes part of the application and has access to all that application's internal structures. This allows you to easily write programs which control (or "script") the application. This is one of the most successful software development
Re: (Score:2)
I hated the whitespace thing in Python, now I'm convinced that every language
Re: (Score:2)
Don't know if you get emails for responses but... Erlang [wikipedia.org] sounds like what you are asking for
Re:Perfect... (Score:5, Insightful)
But Lua is different than those other languages anyway. It's extremely small, both as a language and as a binary. It's also easy to embed anywhere you need it. And finally it's pretty fast as far as dynamic languages go.
Lua doesn't get enough credit these days. It's used in tons of products (especially games) but most of the time people don't realize they are using it.
Re: (Score:2, Interesting)
Why Another Language? (Score:3, Interesting)
Some interpreters, like Perl, are tricky to embed. Lua is very friendly to embedding. You can call user-defined Lua functions from C and call C functions from Lua.
The interpreter is small, and the language is sandboxable - for instance, you could have untrusted Lua running in your webserver and it would have no access to I/O or filesystem.
Re: (Score:1)
Re: (Score:1)
Re: (Score:1)
ref book online (Score:5, Informative)
Anyways the ref book is online:
http://www.lua.org/manual/5.1/ [lua.org]
Re: (Score:2)
B&N?
Addall.com
BookPool.com
Addall will reference Amazon stores and it's not difficult to find a brand new (or "like new", etc.) book. It's like being able to purchase the previously college textbook, but at a discounted price. If I buy books online, I go to those two as a rule.
I suppose some people go to other sities such as OverStock there with other things in mind; e.g., Showing the luscious MILF Sabine Ehrenfeld your "O" face.
Moo (Score:3, Interesting)
Disclaimer or not, should he be allowed as a reviewer?
Hmm, the Review Guidelines [slashdot.org] state So, it OK according to the guidelines. Though, i'd wonder if someone so involved is a good person to actually write such a review.
Re: (Score:1)
I do not understand your comment: "Disclaimer or not". That's precisely why the disclaimer is there -- so that you can make up your own mind about the reviewer! You are a perfect case-in-point! Without the disclaimer, you wouldn't have a clue about the reviewer's past relationship with the author. This way you can
with apologies to steve taylor (Score:5, Funny)
It was a morning just like any other morning
In the Sinai desert, 1200 B.S. (Before Slashdot)
It glistened, it glowed, it rose from the gold of the children of Israel
The chacham cow!
The golden chacham cow had a body like the great cows of ancient Egypt
And a face like the face of Cowboy Neal
And through the centuries it has roamed the earth
Like a ravenous bovine
Seeking whom it may lick
chacham cow!
From the valley of the shadow of fark
To the on-line gambling boutique
From the depths of youtube
To the custom style sheet
The chacham cow lurks
The chacham cow lurks
Who loves you, baby?
Who'll give you good karma?
Who says you'll regret it?
Aaa-ooooooo
Who loves you, baby?
Who'll give you mod points?
Who says you'll regret it?
Aaa-aaa-aaa-ooooooo
I was in love and I needed the clicks
And then I needed more clicks
I was filthy rich and all I wanted were more page views
Woe to you, proud mortal
Secure in your modest digs
You think you're immune?
You, who couldn't finger said cow in a police line-up with the three little pigs!
chacham cow!
Master of disguises!
Who's gonna change shape at will?
Who's the eye on the pyramid on the back of the dollar bill?
Who loves power lunchin' from boing-boing to digg?
Who loves you, baby?
chacham cow comin' to get ya
Why?
Cuz you think this is stupid, don't you?
The chacham cow will not be mocked!
The chacham cow's planning a coup!
The chacham cow chews cud bigger than you!
Woe, woe, woe to you
Who blow off this warning
Perhaps you've already been licked
I, too, was hypnotized
By those big cow eyes
The last time I uttered those four little words
"I deserve better editors!"
Blue PiL (Score:1)
hello world (Score:5, Funny)
print "Hello world"
hope that helps...
Re:hello world (Score:5, Funny)
no no no (Score:2)
Then when they question you, look at them as if they are below you in all ways, then write on the board print "Hello world"
then say "Is testing my knowledge really an indicator? during an interview? I think not."
The go on as if you got the job and the interview is just a minor inconvience.
Re: (Score:3, Interesting)
print ("Hello, world.")
Reader's Digest guide to Lua:
-1) I believe it's 'Lua' not LUA
0) You need the parentheses on function calls.
a) Only data structure is hash tables
b) Hash tables with positive integer indexes emulate arrays (order is maintained)
c) Positive integer indexed hash tables are one-based. Gawd. This makes for some serious unpleasantness if you want to embed Lua in your C application, since many real world things are 0 based and probably all the patterns you know for writing proper loops
Re: (Score:1)
0) You need the parentheses on function calls.
False, f("a string") is equivalent to f"a string" and f({a = b}) is equivalent to f{a = b}
a) Only data structure is hash tables
False, lua tables contain both a hash table part and a pure array part. The runtime figures out how to store stuff internally. As a lua programmer, you never need to care, but if you're only using positive integer keys between 1 and N, with few gaps, it will most likely be stored as an array.
e) No sem
Re: (Score:2)
For a) I maintain my statement; the Lua abstraction is an associative array (commonly called a "hash" by Perl programmers). Efficient use of positive integer indexes is a nice optimiza
Re: (Score:1)
m) No built-in Unicode support (Waaak! How can a modern language not support a wide string type!)
n) Variables are global BY DEFAULT and not local. To declare a local variable you have to say local foo = "blah".
Re: (Score:2)
The GP code works fine:
Plua: Lua on a Palm Pilot (Score:4, Informative)
Re: (Score:1)
Or even geekier, on your DS [dslua.com].
Programming *in* the Lua (Score:5, Funny)
Re: (Score:2)
Re: (Score:1)
Re: (Score:1)
Lua in Hawaiian has, as primary meaning, a hole, pit, or crater - specifically, a hole that has a bottom (vs. a "bottomless" pit), and contrasting with puka - a hole through something. The secondary meaning of lua has been "toilet" since well before the Europeans discovered the Islands.
Celestia (Score:5, Informative)
Lua is the more powerful of the two scripting languages that can be used with Celestia. You can do some awesome stuff with it, and there are lots of examples on various forums (fora?) devoted to Celestia scripting. Good times.
lua uses (Score:3, Informative)
data description language; Lua vs Guile (Score:2)
Re: (Score:2)
It's a shame, as I'd really like to be able to use it. But an "extension" language that isn't as portable as the GUI toolkit I'm using (QT) isn't worth the effort IMHO.
From what little I've read, Lua seems as if it would be a bit more portable.
Re: (Score:1)
Written in very clean C. Tried it with half a dozen compilers and not so much as a warning. If your platform has a C compiler, lua will probably work.
Re: (Score:3, Informative)
Absolutely: The Lua interpreter source code is very clean and well written, and wonderfully portable and platform agnostic.
Here's the source code [lua.org] that you can view online -- there isn't much to it! Four global header files, 19 core C files, 19 core header files, 10 library C files, 1 interpreter C file, and 2 compiler C files. Here is the main loop of the virtual machine [lua.org] -- notice that there are only 38 opcodes [lua.org]!
A great example of some interesting code written in Lua is the Auctioneer [auctioneeraddon.com] add-on for World
Re: (Score:2)
A language shouldn't be used "because it's better than language x" but because it's better for a task.
I certainly haven't been converted over.
Anyway since all your benchmarks compare everything unfavorably to C, you should be using C by your ow
Re: (Score:2)
I gave several reasons why Lua is better than Ruby, for many tasks. Most tasks consider speed and memory usage to be important. Also, Lua is much better than Ruby when it comes to embedding it in an application (like World of Warcraft does). And Lua is also very easy to extend the language with C or C++ code and libraries written in other languages, which is useful for a wide range of tasks. And the fact that it's well written and well designed certainly doesn't hurt.
I still love Python and use it regul
Re: (Score:2)
Re: (Score:2)
That's a total apples-and-oranges comparison. I've used both Lua and Ruby, and liked them both, but there's very little overlap between the
Re: (Score:2)
Lua, on the other hand, is happy to run on
Re: (Score:2)
They address this issue in the book's section on numbers. [lua.org]
It's a scripting language that was designed toward the end of the 20th century. It doesn't need all sorts of integers and whatnot. If you need to care that much about speed, memory consumption, etc, you shouldn't be using an interpreted language in the first place. In the domain for which Lua was designed, tall numeric towers are rice. [funroll-loops.org]
Re: (Score:2)
Lua is a nice language for some purposes, but it has two major limitations. One is that it has no regexp support. It has some limited pattern matching stuff that looks superficially like regexp matching but isn't. This is intentional, in order to keep the footprint small. For game programming you probably don't need regular expressions, but it makes Lua much less suitable than Tcl, Python, or various other scripting languages for anything involved string processing.
Secondly, Lua does not support Unicode
Re: (Score:2)
Secondly, Lua does not support Unicode, which is a defect not only for text processing but for anything requiring serious localization.
That's a showstopper for me. In this day and age no language that claims to be general purpose should be without UTF-8 [wikipedia.org] support. English+ASCII covers only a fraction [ling.gu.se] of the world's languages.
---
The patent mafia: When all they've got is a hammer, everything looks like a nail.
Re: (Score:1)
Re: (Score:2)
Unless you've got more up-to-date information than I have, Lua in fact does not support Unicode. It is true that you can kind of, sort of, manipulate Unicode strings in Lua, but to call this ability support is unwarranted. Here is the discussion of the topic from the Lua Users' Wiki [lua-users.org]. It says that the length functions do not return the number of characters in a string, only the number of bytes. It says that Lua's built-in pattern matching does not work on Unicode. It says that there is no notation that allo
It is an excellent book (Score:5, Informative)
I've read about 3/4 of the book so far and I completely agree with the reviewer's assessment. It's very cleanly and clearly written, with many things explained in a concise and elegant style. For example, Ierusalimschy's explanation of closures allowed me to immediately grasp them and appreciate why they are useful. I remember reading about them way back years ago in Larry Wall's book 'Programming Perl', and was remained rather confused about the concept. I don't know if the additional years of experience helped, but the clear style of the Lua book certainly did.
Using a scripting language for enhancing and extending a complex project just seems to be a given for most serious projects these days, and after surveying the field, I considered only two main choices: Python and Lua. Python is also really well designed and powerful, but I decided to go with Lua because it does pretty much everything I need it to do, does it very well, but best of all, it is so very small. These days when even the most basic projects can quickly grow into complex, interconnected monstrosities with a zillion dependencies, I believe that the values of small and simple are more important than ever. So for that reason especially, I'm really excited about Lua and the prospect for using it more effectively after I finish swallowing this Blue PIL.
mhack
Re: (Score:1)
Re: (Score:2)
populer != best, but best is a relative term. Fit for purpose is more relevent. I do like python, but I'm starting to apreciate what lua enables in game modding, in so far as it involves the games I like.
Re: (Score:1)
Yeah, only a geek would think that being best at something is more important than being popular =P
Pascal (Score:2)
Re: (Score:2)
you want a C/C++-style, Lua-like language? (Score:2)
Lua = moon (Score:2, Interesting)
Brazil (Score:2)
The real reason /. likes LUA is because WoW (Score:1)
PiL is the best language book I have ever read (Score:2, Insightful)
Even if you have no plans to actually program in Lua, you should get this book as an example of how a technical book can and should be written!
While the novice programmer can certainly pick this book up and learn to program (and it is perfectly suited to that), the examples, asides, and discussion in each chapter contain gems for the intermediate to advanced programmer. Everytime I look something up I see a new depth to some language feature or example I didn't see the first time around.
I use Lua becau
What make LUA a very potent scripting language (Score:4, Interesting)
"O no, yet another scripting language finds it way from the obscurity into the lame light". Do we need an extra one if we already have Ruby, Python, Perl, Tcl, Scheme. And I say -- YES, Lua has its place, it is not redundant, it is not "me too" language. And here is why.
I have been expert Ruby coder for the last 5 years using Ruby for data modelling, extensive scripting, wrote load-balancing scripts, Rails Web development, binding C++ libraries to Ruby using SWIG, you name it.
Six month ago I got involved in LUA and I totally fell in love with it.
What does make a beautiful programming language? Lots of features? wealth of libraries? simplicity of it? I think that language design is more art than science and the language beauty is the careful balance of features, simplicity, semantics, uniformity, etc. Like in a masterpiece painting it is the balance of color, shapes, motives and composition.
C, for example, ia a beautiful language in the category of "portable assemblers". In that category C is powerful thanks to its libraries, simple and easily implementable thanks to its syntax and semantics, portable due to very clever and clean hardware abstraction.
I think that Lua is to "high level scripting languages" is what C is to "portable assemblers". Lua has both OO and functional programming very naturally represented in its semantics. All objects are first class (including functions). Lua is small, very fast (in fact fastest scripting language according to http://shootout.alioth.debian.org/ [debian.org]), has very good Virtual Machine, incremental Garbage Collector. As far as fundamantals are concerned, Lua is light-years ahead of Ruby. It still lags behind in library support, but the recent progress is very encouraging.
Anyway, give Lua a try. You will love it. Lua is nice, its codebase is tiny (about 10K lines). It runs on anything that support ANSI C compiler including embedded stuff (ARM, Palm, Cell phones, MIPS, x86, etc).
Pretty good, honestly. (Score:1)
I really recommend this book to anyone (Score:2)
Suggestion (Score:2)
Re:Just what the world needs (Score:5, Informative)
Re: (Score:1)
Re: (Score:1)
Re: (Score:2, Interesting)
Comment removed (Score:4, Insightful)
Re: (Score:2)
Re: (Score:3, Informative)
If it really, really, really bothers you that Lua doesn't have enough restrictions on distribution, you are quite free to download a copy, stick a GPL license on it, and use that. How about that?
Re: (Score:2)
No zealot of the GP's stripe would ever consider using the term "open-source", which Lua most certainly is.
Sometimes even RMS is pragmatic -- I recall when he was advocating that Ogg Vorbis use the BSD license. I really don't know what prompted that change in tune for just that one instance, since as far as I can see, it's yet to be repeated.
Re: (Score:1)
Re: (Score:2)
Libre? As long as we have Cuba! (Score:1)
But to get back to licensing, LUA probably has the best licensing for a scripting language of its ilk, considering the fact it's an ideal candidate for full embedding in anything that needs object oriented smart scripting (which applies to pretty much all games with 'mobiles' or XML based UI's), so actually giving it the licensing it has was a brilliant move to get it spread.
Splut.
Re: (Score:1)
However, http://wiki.litestep.com/Modules:LSLua [litestep.com] will explain how its used, which is probably all you want anyway.